{include file="header.html"}
<link rel="stylesheet" href="{url('/style/css/member.css')}">
<script type="text/javascript" src="/style/dp/WdatePicker.js"></script>
{include file="ur_here.html"}
<div id="container">
    <div class="fn-clear mt20 pb20">
        {include file="member/menu.html"}
        <div class="fn-right hy-r">
        <div class="hy-tjxh fn-clear">
            <ul class="fn-clear db-tab">
                <li class="dq"><a href="{url('/member/db')}">{$L.unit_yun}记录</a></li>
                <li><a href="{url('/member/luck')}">{$L.unit_winning}记录</a></li>
            </ul>

            <div class="db-nrbox fn-clear">
                <div class="dq-lifl">
                    <a href="{url('/member/db')}" {if !isset($smarty.get.order)}class="dq"{/if}>参与成功</a>   |   <a href="{url('/member/db')}?order" {if isset($smarty.get.order)}class="dq"{/if}>未付款</a>
                </div>
                {if !isset($smarty.get.order)}
                <div class="dq-ts">
                    我的参与提醒： 即将揭晓{$L.unit_price}<a href="{url('/member/db')}?type=1" class="color01 fwb">（{$total.wait}）</a> 进行中的{$L.unit_price}<a href="{url('/member/db')}?type=2" class="color01 fwb">（{$total.ing}）</a> 已揭晓{$L.unit_price}<a href="{url('/member/db')}?type=3" class="color01 fwb">（{$total.end}）</a>
                </div>
                {/if}
                <div class="fn-clear mt20">
                    <div class="fn-left db-sxl">
                        <a href="{url('/member/db')}{if isset($smarty.get.order)}?order{/if}" {if $smarty.get.time eq ''}class="dq"{/if}>全部</a>
                        <a href="{url('/member/db')}?time=1{if isset($smarty.get.order)}&order{/if}" {if $smarty.get.time eq 1}class="dq"{/if}>今天</a>
                        <a href="{url('/member/db')}?time=2{if isset($smarty.get.order)}&order{/if}" {if $smarty.get.time eq 2}class="dq"{/if}>本周</a>
                        <a href="{url('/member/db')}?time=3{if isset($smarty.get.order)}&order{/if}" {if $smarty.get.time eq 3}class="dq"{/if}>本月</a>
                        <a href="{url('/member/db')}?time=4{if isset($smarty.get.order)}&order{/if}" {if $smarty.get.time eq 4}class="dq"{/if}>最近三个月</a>
                    </div>
                    <form action="{url('/member/db')}">
                    <div class="fn-right db-sxr">
                        <label id="Label1">选择时间段：</label>
                        <input name="from_data" type="text" onclick="WdatePicker()" class="dq-inpt" />
                        <label id="Label1">-</label>
                        <input name="to_data" type="text"  onclick="WdatePicker()" class="dq-inpt"  />
                        {if isset($smarty.get.order)}
                        <input type="hidden" name="order">
                        {/if}
                        <input type="submit" value="搜索" />
                    </div>
                    </form>
                </div>
                {if !isset($smarty.get.order)}
                <div class="dq-tab-t">
                    <table>
                        <tr>
                            <th style="width:116px;">{$L.unit_price}图片</th>
                            <th style="width:450px;">{$L.unit_price}名称</th>
                            <th style="width:80px;">{$L.unit_yun}状态</th>
                            <th style="width:80px;">参与人次</th>
                            <th>{$L.unit_yun}号码</th>
                        </tr>
                    </table>
                </div>
                <div class="db-tab-list">
                    <table>
                        {if $list}
                        {foreach from=$list item=m}
                        <tr>
                            <td style="width:116px;">
                                <div class="db-img"><img src="{zz mod=fileurl source=$m.imgurl_thumb}" alt="{$m.goods_name}" /></div>
                            </td>
                            <td style="width:450px;">
                                <div class="dq-jd">
                                    {if $m.type eq 2}<span class="type-free">霸王餐区</span> {/if}<a href="{'/yunbuy/detail/'|cat:$m.buy_id|url}" target="_blank">(第{$m.qishu}期) {$m.goods_name}</a>
                                    <p>总需：{$m.buy.need_num}{if $m.type eq 1}人次{else}{$L.unit_pay_points}{/if}</p>
                                    {if $m.buy.luck_code eq 0}
                                    <div class="db-jdt">
                                        <span style="width:{$m.buy.jindu}%"></span>
                                    </div>
                                    <ul class="fn-clear db-jdtxt">
                                        <li class="tl"><strong>{$m.buy.end_num}</strong><p>剩余人次</p></li>
                                        <li class="tr"><strong>{$m.buy.buy_num}</strong><p>已参与人次</p></li>
                                    </ul>
                                    {else}
                                    获得者：<a href="{'/minfo?id='|cat:$m.buy.member_id|url}#dbCod" target="_blank">{$m.buy.member_name|nickname:$m.luck_nickname}</a>（本期共参与{$m.luck_qty}人次）<br/>
                                    幸运号码：<b class="color01">{$m.buy.luck_code}</b><br/>
                                    揭晓时间：{microtime_format($m.buy.end_time,'Y-m-d H:i:s.x')}
                                    {/if}
                                </div>
                            </td>
                            <td style="width:80px;">
                                {if $m.status eq 2}
                                <span class="color02">正进行.....</span>
                                {elseif $m.status eq 3}
                                <span class="color01">已{$L.unit_winning}</span>
                                {elseif $m.status eq 4}
                                <span class="color03">待揭晓</span>
                                {elseif $m.status eq 5}
                                <span class="color01">已揭晓</span>
                                {/if}
                            </td>
                            <td style="width:80px;">{$m.qty}人次 {if $m.multi gt 1}<br/><span class="color01">参与{$m.multi}期</span>{/if}</td>
                            <td>
                                <ul>
                                    {foreach from=$m.yun_code item=c name=yun_code}
                                    {if $smarty.foreach.yun_code.iteration lt 10}<li style="width: 50%; float: left;">{$c}</li>{/if}
                                    {/foreach}
                                    <li><a href="{'/minfo?id='|cat:$m.mid}#db#vid={$m.buy_id}" target="_blank" class="color02">查看更多&gt;&gt;</a></li>
                                </ul>
                            </td>
                        </tr>
                        {/foreach}
                        {else}
                        <tr><td>暂时没有相关记录</td></tr>
                        {/if}
                    </table>
                </div>
                {else}
                <div class="dq-tab-t">
                    <table>
                        <tr>
                            <th style="width:116px;">{$L.unit_price}图片</th>
                            <th style="width:450px;">{$L.unit_price}名称</th>
                            <th style="width:120px;">{$L.unit_yun}状态</th>
                            <th>参与人次</th>
                        </tr>
                    </table>
                </div>
                <div class="db-tab-list">
                    <table>
                        {if $list}
                        {foreach from=$list item=r}
                        <div class="db-tab-list">
                            <table>
                                <tr>
                                    <th colspan="2" style="text-align:left; padding-left:30px;">订单号：{$r.order_sn} {$L.unit_yun}时间：{$r.add_time|date_format:'Y-m-d H:i:s'}        </th>
                                    <th nowrap>
                                        <span class="color01">
                                            {if $r.type eq 1}
                                            还需支付：{$r.order_amount}{$L.unit_db_points}
                                            {else}
                                            总价：{$r.total}{$L.unit_pay_points}
                                            {/if}
                                        </span>
                                    </th>
                                    <th style="width:130px;">{if $r.allow_pay}<a href="{'/yunbuy/pay/'|cat:$r.order_sn|url}" target="_blank" class="db-btn">支付订单</a>{/if}</th>
                                </tr>
                                {foreach from=$r.db item=m}
                                <tr>
                                    <td style="width:116px;">
                                        <div class="db-img"><img src="{$m.imgurl_thumb}" alt="{$m.goods_name}" /></div>
                                    </td>
                                    <td style="width:450px;">
                                        <div class="dq-jd">
                                            {if $m.type eq 2}<span class="type-free">霸王餐区</span> {/if}<a href="{'/yunbuy/detail/'|cat:$m.buy_id|url}" target="_blank">(第{$m.qishu}期) {$m.goods_name}</a>
                                            <p>总需：{$m.buy.need_num}{if $m.type eq 1}人次{else}{$L.unit_pay_points}{/if}</p>
                                            {if $m.buy.luck_code eq 0}
                                            <div class="db-jdt">
                                                <span style="width:{$m.buy.jindu}%"></span>
                                            </div>
                                            <ul class="fn-clear db-jdtxt">
                                                <li class="tl"><strong>{$m.buy.end_num}</strong><p>剩余人次</p></li>
                                                <li class="tr"><strong>{$m.buy.buy_num}</strong><p>已参与人次</p></li>
                                            </ul>
                                            {else}
                                            获得者：<a href="{'/minfo?id='|cat:$m.buy.member_id|url}#db" target="_blank">{$m.buy.member_name}</a>（本期共参与{$m.luck_qty}人次）<br/>
                                            幸运号码：<b class="color01">{$m.buy.luck_code}</b><br/>
                                            揭晓时间：{microtime_format($m.buy.end_time,'Y-m-d H:i:s.x')}
                                            {/if}
                                        </div>
                                    </td>
                                    <td style="width:120px;">
                                        {if $m.status eq 2}
                                        <span class="color02">正进行.....</span>
                                        {elseif $m.status eq 3}
                                        <span class="color01">已{$L.unit_winning}</span>
                                        {elseif $m.status eq 5}
                                        <span class="color01">已揭晓</span>
                                        {/if}
                                    </td>
                                    <td style="width:80px;">{$m.qty}人次</td>
                                </tr>
                                {/foreach}
                            </table>
                        </div>
                        {/foreach}
                        {else}
                        <tr><td>暂时没有相关记录</td></tr>
                        {/if}
                    </table>
                </div>
                {/if}
                <div class="foot-btn">
                    {include file="public_page.html"}
                </div>
            </div>



        </div>





        </div>
     </div>
</div>
{include file="footer.html"}